From: Jyrki Gadinger Date: Fri, 17 Jan 2025 13:28:11 +0000 (+0100) Subject: persist credentials retrieved through the wizard X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~109^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=75fdfea2126c2425859ff57cc56e17daddf1080d;p=nextcloud-desktop.git persist credentials retrieved through the wizard When setting up an account through the wizard for the first time, the credentials are not saved properly. This requires the user to sign in again after an application restart. At least for the login flow v2 case, the `WebFlowCredentials` class eventually persists the retrieved credentials, whereas the class used within the wizard (`OCC::Flow2AuthCredsPage`) doesn't. Signed-off-by: Jyrki Gadinger --- diff --git a/src/gui/creds/webflowcredentials.cpp b/src/gui/creds/webflowcredentials.cpp index 0495d3b88..bd2eb458e 100644 --- a/src/gui/creds/webflowcredentials.cpp +++ b/src/gui/creds/webflowcredentials.cpp @@ -213,6 +213,7 @@ bool WebFlowCredentials::stillValid(QNetworkReply *reply) { void WebFlowCredentials::persist() { if (_user.isEmpty()) { // We don't even have a user nothing to see here move along + qCWarning(lcWebFlowCredentials) << "_user is unset, nothing to persist ..."; return; } diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index 58a6d613f..6b36e0fe7 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -339,6 +339,7 @@ void OwncloudSetupWizard::slotConnectToOCUrl(const QString &url) AbstractCredentials *creds = _ocWizard->getCredentials(); if (creds) { _ocWizard->account()->setCredentials(creds); + creds->persist(); } const auto fetchUserNameJob = new JsonApiJob(_ocWizard->account()->sharedFromThis(), QStringLiteral("/ocs/v1.php/cloud/user"));